<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <script src="../build/react.development.js"></script>
    <script src="../build/react-dom.development.js"></script>
    <script src="../build/babel.min.js"></script>
  </head>
  <body>
    <div id="example"></div>
    <script type="text/babel">
      class NotesList extends React.Component {
        render() {
          return (
            <ol>
              {
                React.Children.map(this.props.children, function (child) {
                  return <li>{child}</li>;
                })
              }
            </ol>
          );
        }
      }

      class ItemList extends React.Component {
        render(){
          // return 后面一定要加小括号
          return (
            <ol>{React.Children.map(this.props.children,(child)=>{
                return <li>{child}</li>
            })}</ol>
            )
        }
      }

      ReactDOM.render(
        <div>
        <NotesList>
          <span>hello</span>
          <span>world</span>
        </NotesList>
        <ItemList>
          <a>USD</a>
          <a>CNY</a>
        </ItemList>
        </div>
        ,
        document.getElementById('example')
      );
    </script>
  </body>
</html>

